home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / E-P-O.ZIP / FLOOR.INC < prev    next >
Encoding:
Text File  |  1996-10-31  |  3.3 KB  |  94 lines

  1.  
  2. //------------------------------------------------------------------->
  3. //
  4. // floor.inc
  5. //
  6. // "Easy POV Oven"
  7. //
  8. // Written By: Paul T. Dawson
  9. //             ptdawson@voicenet.com
  10. //             http://www.voicenet.com/~ptdawson
  11. //
  12. // All code and techniques are PUBLIC DOMAIN - have fun with it!
  13. //
  14. //------------------------------------------------------------------->
  15. //
  16. // This file builds the "Floor_Tile" object.
  17.  
  18. //------------------------------------------------------------------->
  19. //
  20. // Make the textures.
  21.  
  22.         #declare Tex_1 = texture { pigment { SteelBlue }
  23.                 finish { F_MetalC } }
  24.  
  25.         #declare Tex_2 = texture { pigment { Yellow }
  26.                 finish { F_MetalC } }
  27.  
  28.         #declare Tex_3 = texture { pigment { NewMidnightBlue }
  29.                 finish { F_MetalC } }
  30.  
  31. //------------------------------------------------------------------->
  32. //
  33. // Use two loops to make 12x12 squares for one tile.
  34.  
  35.         #declare Count_Temp = 0
  36.  
  37.         #declare Floor_Tile = mesh {
  38.  
  39.         #declare X = 0 #while ( X < 12 )
  40.         #declare Z = 0 #while ( Z < 12 )
  41.  
  42.                 // Four corners.
  43.                         #declare T1 = < X, 0, Z >
  44.                         #declare T2 = < X, 0, Z+1 >
  45.                         #declare T3 = < X+1, 0, Z+1 >
  46.                         #declare T4 = < X+1, 0, Z >
  47.  
  48.                 // Center point.
  49.                         #declare T5 = < X+0.5, 0.2, Z+0.5 >
  50.  
  51.                 // Decide on a color.
  52.  
  53.                         #declare Kolor = 1
  54.  
  55.                         #if ( X= 0 ) #declare Kolor = 3 #end
  56.                         #if ( Z=11 ) #declare Kolor = 3 #end
  57.  
  58.                         #if ( (X= 2) & (Z= 1) ) #declare Kolor = 2 #end
  59.                         #if ( (X=10) & (Z= 1) ) #declare Kolor = 2 #end
  60.                         #if ( (X= 2) & (Z= 9) ) #declare Kolor = 2 #end
  61.                         #if ( (X=10) & (Z= 9) ) #declare Kolor = 2 #end
  62.  
  63.                 // Four triangles.
  64.                         #if ( Kolor = 1 )
  65.                                 triangle { T1,T2,T5 texture { Tex_1 } }
  66.                                 triangle { T2,T3,T5 texture { Tex_1 } }
  67.                                 triangle { T3,T4,T5 texture { Tex_1 } }
  68.                                 triangle { T4,T1,T5 texture { Tex_1 } }
  69.                         #end
  70.                         #if ( Kolor = 2 )
  71.                                 triangle { T1,T2,T5 texture { Tex_2 } }
  72.                                 triangle { T2,T3,T5 texture { Tex_2 } }
  73.                                 triangle { T3,T4,T5 texture { Tex_2 } }
  74.                                 triangle { T4,T1,T5 texture { Tex_2 } }
  75.                         #end
  76.                         #if ( Kolor = 3 )
  77.                                 triangle { T1,T2,T5 texture { Tex_3 } }
  78.                                 triangle { T2,T3,T5 texture { Tex_3 } }
  79.                                 triangle { T3,T4,T5 texture { Tex_3 } }
  80.                                 triangle { T4,T1,T5 texture { Tex_3 } }
  81.                         #end
  82.  
  83.                         #declare Count_Temp = Count_Temp + 4
  84.  
  85.         #declare Z = Z + 1 #end
  86.         #declare X = X + 1 #end
  87.  
  88.         } // End of mesh.
  89.  
  90. //------------------------------------------------------------------->
  91. //
  92. // End of this file.
  93.  
  94.